import request from "@/utils/request";

const urlMiddlePath = "/business/Comments/";

// 创建留言
export function createCommentApi(data) {
  return request({
    url: urlMiddlePath + "create",
    method: "post",
    data,
  });
}

// 查询所有留言
export function getCommentListApi(params) {
  return request({
    url: urlMiddlePath + "list",
    method: "get",
    params,
  });
}

// 查询单个留言
export function getCommentInfoByIdApi(id) {
  return request({
    url: urlMiddlePath + `getInfoById?id=${id}`,
    method: "get",
  });
}

// 更新留言
export function updateCommentInfoByIdApi(id, data) {
  return request({
    url: urlMiddlePath + `updateInfoById?id=${id}`,
    method: "post",
    data,
  });
}

// 删除留言
export function deleteCommentInfoByIdApi(id) {
  return request({
    url: urlMiddlePath + `delete?id=${id}`,
    method: "get",
  });
}
